if (NOT PCL_FOUND)
    find_package(PCL  REQUIRED)
endif ()
# if (NOT LIVOXLIDAR_FOUND)
#     find_package(LIVOXLIDAR  REQUIRED)
# endif()
# if (NOT Boost_FOUND)
find_package(Boost  REQUIRED COMPONENTS system thread)
# endif ()
find_package(Eigen3 REQUIRED)

if (NOT OPENMP_FOUND)
    find_package(OpenMP)
endif ()
if (OPENMP_FOUND)
    message(STATUS "Found openmp")
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
add_library(livox_lidar SHARED
        # livox_m.cc
        # livox_m.h
        livox.cc
        livox.h
        ./odometry/odometry.cpp
        # ${PROJECT_SOURCE_DIR}/odometry/odometry.cpp
        # ${PROJECT_SOURCE_DIR}/PCLfunctions/pcl_functions.cpp
        )
# target_include_directories(livox_lidar PUBLIC  ./ ${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${LIVOXLIDAR_INCLUDE_DIRS} )
target_include_directories(
    livox_lidar PUBLIC  
    # ./ 
    ${Boost_INCLUDE_DIRS} 
    ${PCL_INCLUDE_DIRS} 
    ${APR_INCLUDE_DIRS} 
    ${EIGEN3_INCLUDE_DIR}
    ./odometry
    # ${PROJECT_SOURCE_DIR}/odometry
    # ${PROJECT_SOURCE_DIR}/PCLfunctions
    )
# target_link_libraries(livox_lidar  ${Boost_LIBRARIES} ${LIVOXLIDAR_LIBS} ${PCL_LIBRARIES} )
target_link_libraries(livox_lidar  
    ${Boost_LIBRARIES} 
    livox_sdk_static 
    ${PCL_LIBRARIES} 
    ${APR_LIBRARIES}
    )

